<?php


namespace app\api\controller;

use app\common\controller\Api;
use think\Db;


/**
 * 公共接口
 */
class Service extends Api
{

    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $this->success('请求成功');
    }

    /*
     *获取服务详情
     *
     *
     * */
    public function detail()
    {
        //设置过滤方法
        $this->request->filter(['strip_tags']);

        $service_id = $this->request->request('id');

        if (!$service_id) {
            $this->success('缺少必要参数！', null, 201);
        }
        $service = Db::table('fa_service')
            ->field(['createtime', 'updatetime', 'deletetime', 'status', 'weigh'], true)
            ->where('id', $service_id)
            ->find();

        $this->success('ok', ['service' => $service], 200);
    }


}
